﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using YaTools.Yaml;
using System.Collections;

namespace revoStore
{
    class Package
    {
        #region "Proprietes"
        private string _name;
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        private App _application;
        public App Application
        {
            get { return _application; }
            set { _application = value; }
        }
        #endregion

        Hashtable yaml;
        Hashtable recipe;
        

        public Package(string packageFile, bool runInstall = true)
        {
            yaml = YamlLanguage.FileTo(packageFile) as Hashtable;
            recipe = yaml["Package"] as Hashtable;
            var title = recipe["Title"] as string;

            this._application = new App();

            var name = recipe["Name"] as string;
            var desc = recipe["Description"] as string;
            var dev = recipe["Developer"] as string;
            var type = (AppType)Enum.Parse(typeof(AppType), recipe["Type"] as string, true);
            var reqadm = recipe["RequireAdmin"] as string;
            var action = recipe["RequireAdmin"] as string;
            var reqadm = recipe["RequireAdmin"] as string;
        }
    }
}
